package cndw.core.dispatch;

/**
 * Response工厂
 * @author zuojie.x
 */
public final class ResponseFactory {
	
	public static Response ok(Object result) {
		return new DefaultResponse(ResponseCode.OK, null, result);
	}
	
	static Response ok(Request request, Object result) {
		return new DefaultResponse(ResponseCode.OK, request, result);
	}
	
	public static Response fail(Object result) {
		return new DefaultResponse(ResponseCode.FAIL, null, result);
	}
	
	static Response create(ResponseCode code, Request request) {
		return new DefaultResponse(code, request, null);
	}
}
